package javaEE65_day05.com.itheima.Test06;

public class Test06 implements ArrayOperate {
    public static void main(String[] args) {
        int[] arr = {18,9,28,34,10,78};
        //需求：通过调用getMax方法求arr数组的最大值
        ArrayOperate ao = arr1 -> {
            int max = arr1[0];
            for (int i = 0; i < arr1.length; i++) {
                if (arr1[i] > max){
                    max = arr1[i];
                }
            }
            return max;
        };
        int m = getMax(ao, arr);
        System.out.println(m);
    }
    public static int getMax(ArrayOperate ao,int[] arr) {
        return ao.getMax(arr);
    }


    @Override
    public int getMax(int[] arr) {
        return 0;
    }
}
